<form class="ui-form" action="<?php echo url_for('socialMedia/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <?php if (!$form->getObject()->isNew()): ?>
    <input type="hidden" name="sf_method" value="put" />
    <?php endif; ?>
    <?php echo $form->renderHiddenFields() ?>
    <fieldset class="ui-widget ui-fieldset slide">

        <div class="ui-widget-header ui-form-legend ui-corner-top-5">
            <?php if ($form->getObject()->isNew()): ?>
                <p class="ui-icon-16 ui-icon-link-add"></p>
            <?php endif; ?>
            <?php if (!$form->getObject()->isNew()): ?>
                <p class="ui-icon-16 ui-icon-link-edit"></p>
            <?php endif; ?>
            <legend class="ui-widget-title">
                <?php if ($form->getObject()->isNew()): ?>
                    <?php echo __('Neue ') ?>
                <?php endif; ?>
                <?php echo __('Social-Media Seite') ?>
            </legend>
        </div>
        
        <div class="ui-widget-content ui-fieldset-content">
            
            <div class="ui-form-field">
                <?php echo $form['site']->renderLabel(null, array('class' => 'ui-label')) ?>
                <?php echo $form['site']->render(array('class' => 'ui-textfield')) ?>
                <p class="ui-input-description"><?php echo __($form['site']->renderHelp()) ?></p>
                <?php if ($form['site']->hasError()): ?>
                    <?php echo $form['site']->renderError() ?>
                <?php endif; ?>
            </div>
            <div class="ui-form-field">
                <?php echo $form['url']->renderLabel(null, array('class' => 'ui-label')) ?>
                <?php echo $form['url']->render(array('class' => 'ui-textfield')) ?>
                <p class="ui-input-description"><?php echo $form['url']->renderHelp() ?></p>
                <?php if ($form['url']->hasError()): ?>
                    <?php echo $form['url']->renderError() ?>
                <?php endif; ?>
            </div>
            
            <?php if ($sf_user->hasFlash('error')): ?>
                <div class="ui-form-field ui-form-response">
                    <label class="ui-label ui-label-error"><?php echo __('Server Antwort') ?></label>
                    <p class="ui-form-error ui-state-error ui-corner-all"><?php echo __($sf_user->getFlash('error'), array(), 'sf_admin') ?></p>
                </div>
            <?php endif; ?>
            <?php if ($sf_user->hasFlash('notice')): ?>
                <div class="ui-form-field ui-form-response">
                    <label class="ui-label"><?php echo __('Server Antwort') ?></label>
                    <p class="ui-form-notice ui-state-highlight ui-corner-all"><?php echo __($sf_user->getFlash('notice'), array(), 'sf_admin') ?></p>
                </div>
            <?php endif; ?>
            
        </div>
        
        <div class="ui-widget-header ui-form-footer ui-corner-bottom-5">
            &nbsp;<a class="ui-back ui-button" href="<?php echo url_for('socialMedia/index') ?>"><?php echo __('Zurück') ?></a>
            <?php if (!$form->getObject()->isNew()): ?>
                &nbsp;<?php echo link_to('Löschen', 'socialMedia/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'class' => 'ui-delete ui-button','confirm' => 'Bist Du sicher?')) ?>
            <?php endif; ?>
            <button class="ui-submit ui-button" value="Save"><?php echo __('Erstellen') ?></button>
        </div>
            
    </fieldset>
      

</form>
